import request from '@/utils/request'

/**

/**
 * 文件上传
 * @param {*} file
 */
export function upload(data) {
  const env = process.env.VUE_APP_ENV
  const envMaps = {
    test: 'https://testlife.eshimin.com/coss',
    production: 'https://life.eshimin.com/coss',
    development: ''
  }
  const params = {
    method: 'post',
    url: '/upload',
    data
  }
  const baseURL = envMaps[env]
  if (baseURL) {
    params['baseURL'] = baseURL
  }
  return request(params)
}
